{% extends "profilebase.html" %}

{% block sidebar_title %}
{% if profileOwner %}
	{% if currentUser.category == "institute" %}
		<h4>About Us</h4>
	{% else %}
		<h4>About Me</h4>
	{% endif %}
	{% else %}
		<h4>About {{ currentUser.abstract_user.user.username }}</h4>
	{% endif %}
{% endblock %}

{% block sidebar_content %}

{% if photo %}			
	<img border="0" src={{ "../"|add:photo.path }} />
{% endif %}

{% if currentUser.category == "institute" %}
	{% if my_teachers %}
		<h5>Our Teachers:</h5>
		{% for teacher in my_teachers %}
			<label style="font-size:15px;"><a href="/myprofile/{{ teacher.abstract_user.id }}/">{{ teacher.abstract_user }}</a></label><br/>
			<small>Teaches: {{ teacher.teaches }}</small><br/><br/>
		{% endfor %}
	{% endif %}
{% endif %}

{% if currentUser.category == "teacher" %}
	{% if my_institutes %}
			<h5>Work at:</h5>
			{% for institute in my_institutes %}
				<p style="font-size:15px"><a href="/myprofile/{{ institute.abstract_user.id }}/">{{ institute.abstract_user }}</a></p>
			{% endfor %}
	{% endif %}
{% endif %}


{% if profileOwner %}
	{% if currentUser.category == "institute" %}
	
		<h5>About: </h5><p>{{ currentUser.about|default:"Tell us all about your institute" }}</p>
		<h5>Open On: </h5><p>{{ currentUser.open_on|default:"Ahm, is it closed all the time?" }}</p>
		<h5>Open From: </h5><p>{{ currentUser.open_from|default:"Is it open 24hrs aday?" }}</p>
		<h5>Open To: </h5><p>{{ currentUser.open_to|default:"Never closes?"}}</p>
		<h5>Address: </h5><p>{{ currentUser.address|default:"Even if you're located on Mars, you can tell us, we really don't mind" }}</p>
		
	{% else %}
	
		<h5>Date of Birth: </h5><p>{{ currentUser.dob|default:"Not entered yet" }}</p>
		<h5>Gender: </h5><p>{{ currentUser.gender|default:"Are you unsure?" }}</p>
		<h5>Experience: </h5><p>{{ currentUser.experience|default:"Come on, BRAG!" }}</p>
		<h5>Favorite Genre/s: </h5><p>{{ currentUser.favourite_genre|default:"Hmm, you must like something, right?" }}</p>
		<h5>Instrument/s Played: </h5><p>{{ currentUser.instrument_played|default:"Ahm, it is kind of in the definition of a musician to play something. Unless you're a vocalist...'" }}</p>
		<h5>Jamming Style: </h5><p>{{ currentUser.jamming_style|default:"Tell us..." }}</p>
		
		{% if currentUser.category == "teacher" %}
			<h5>Teach: </h5><p>{{ teacher.teaches|default:"Advertise for yourself..." }}</p>
		{% endif %}
			
	{% endif %}
	
	<a href="/editInfo/">Edit My Info</a> - 
	{% if photo %}	
		<a href="/myprofile/uploadImage/">Change Photo</a> - 
	{% else %}
		<a href="/myprofile/uploadImage/">Upload a Photo</a> - 
	{% endif %}
	<a href="/myprofile/changePassword/">Change Password</a>
	
{% else %}
	{% if currentUser.category == "institute" %}
		{% if currentUser.about %}
			<h5>About: </h5><p>{{ currentUser.about }}</p>
		{% endif %}
		{% if currentUser.open_on %} 
			<h5>Open On: </h5><p>{{ currentUser.open_on }}</p> 
		{% endif %}
		{% if currentUser.open_from %} 
			<h5>Open From: </h5><p>{{ currentUser.open_from }}</p> 
		{% endif %}
		{% if currentUser.open_to %} 
			<h5>Open To: </h5><p>{{ currentUser.open_to }}</p> 
		{% endif %}
		{% if currentUser.address %} 
			<h5>Address: </h5><p>{{ currentUser.address }}</p> 
		{% endif %}
		
	{% else %}
	
		{% if currentUser.dob %} 
			<h5>Date of Birth: </h5><p>{{ currentUser.dob }}</p> 
		{% endif %}
		{% if currentUser.gender %} 
			<h5>Gender: </h5><p>{{ currentUser.gender }}</p> 
		{% endif %}
		{% if currentUser.experience %} 
			<h5>Experience: </h5><p>{{ currentUser.experience }}</p> 
		{% endif %}
		{% if currentUser.favourite_genre %} 
			<h5>Favourite Genre/s: </h5><p>{{ currentUser.favourite_genre }}</p> 
		{% endif %}
		{% if currentUser.instrument_played %} 
			<h5>Instrument/s Played: </h5><p>{{ currentUser.instrument_played }}</p> 
		{% endif %}
		{% if currentUser.jamming_style %} 
			<h5>Jamming Style: </h5><p>{{ currentUser.jamming_style }}</p> 
		{% endif %}
		
		{% if currentUser.category == "teacher" %}
			{% if currentUser.teaches %}
				<h5>Teach: </h5><p>{{ currentUser.teaches }}</p>
			{% endif %}
		{% endif %}
			
	{% endif %}
	
{% endif %}
{% endblock %}

{% block main_title %}
<h1>Updates</h1>
{% if profileOwner %}
	<small>
	Text: just write what you want<br/>
	Video: Post a <a href="http://www.youtube.com/" target="_blank">Youtube</a> link<br/>
	Audio: Post a <a href="http://www.soundcloud.com/" target="_blank">Soundcloud</a> embed code (choose 'share' then copy the embed code, deselect "user html5 widget")<br/>
	</small>
{% endif %}
{% endblock %}

{% block main_subtitle %}
<a href="/">All</a>	|	
{% if currentUser.category == "teacher" %}
	<a href="/myprofile/other/{{ currentUser.abstract_user.id }}/">Lessons</a>	|
{% endif %}
{% if currentUser.category == "student" %}
	<a href="/myprofile/other/{{ currentUser.abstract_user.id }}/">My Jams</a>	|
{% endif %}
{% if currentUser.category == "institute" %}
	<a href="/myprofile/other/{{ currentUser.abstract_user.id }}/">Our Talent</a>	|
{% endif %}

<a href="/myprofile/fav/{{ currentUser.abstract_user.id }}/">Favorites</a>
<br/><br/>
{% endblock %}

{% block main_content %}
{% if profileOwner %}
	<form action="/myprofile/postUpdate/" method="POST">{% csrf_token %}
		<input type="text" name="entry" size=80/>
		<input type="submit" id="search_btn" value="Post"><br/><br/>
		
		<input type="checkbox" name="other" value="on" />
		{% if currentUser.category == "teacher" %}Lesson{% endif %}
	
		{% if currentUser.category == "student" %}Jam{% endif %}
	
		{% if currentUser.category == "institute" %}Talent{% endif %}
	
		<input type="checkbox" name="fav" value="on" />Favorite
		
		<br /><br /><br />
	</form>
{% endif %}

{% for update, count in updates %}
	<li>
	{%  if update.video_id %}
		<iframe width="560" height="315" src="http://www.youtube.com/embed/{{ update.video_id }}" frameborder="0" allowfullscreen></iframe>
		<br/>
		{% if count > 0 %}<small><a href="/myprofile/mediaReviews/{{ update.id }}/">view {{ count }} reviews</a> - </small>{% endif %}
		{% if not profileOwner and areFriends %}
			<small><a href="/myprofile/review/{{ update.id }}/{{ currentUser.abstract_user.id }}/">review</a></small>
		{% endif %}
	{% endif %}

	{% if update.content %}
		{{ update.content|safe }}
		<br/>
	{% endif %}

	{% if update.mp3_url %}
		{{ update.mp3_name }}
		<object height="100" width="100%"> 
			<param name="movie" value={{ update.mp3_url }}/> 
		</object> 
		<br/>
		{% if count > 0 %}<small><a href="/myprofile/mediaReviews/{{ update.id }}/">view {{ count }} reviews</a> - </small>{% endif %}
		{% if not profileOwner and areFriends %}
			<small><a href="/myprofile/review/{{ update.id }}/{{ currentUser.abstract_user.id }}/">review</a></small>
		{% endif %}
	{% endif %}
	
	{% if profileOwner %}
		<small><a href="/myprofile/deleteUpdate/{{ update.id }}/">delete</a></small>
	{% endif %}
	
	</li>
	<br/><br/><br/><br/>
{% endfor %}
{% if more_updates_available %}
<br/>
<li><small><a href="/myprofile/viewMoreUpdates/{{ updates_type }}/{{ currentUser.abstract_user.id }}/{{ updates|length }}">view more updates</a></small></li>
{% endif %}
{% endblock %}
